<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller{

	public function __construct(){
		parent::__construct();

	}

    public function myview($page, $params=null, $styles=null ,$scripts=null)
	{   
		$datas = array();
		$datas['activemenu'] = str_replace('/','',$this->uri->slash_segment(1));

		if(!empty($params)) $datas = array_merge($datas,$params);
		$this->load->vars($datas);
		$this->template->set_template('default');
		if(!empty($styles)){
			foreach($styles as $style){
				$this->template->add_css('themes/'.$style);	
			}
		}
		if(!empty($scripts)){
			foreach($scripts as $script){
				$this->template->add_js('scripts/'.$script);	
			}
		}		
		$this->template->write_view('content', $page);
		$this->template->render();
	}
	
    public function myweerayaview($page, $params=null, $styles=null ,$scripts=null)
	{   
		$datas = array();
		$datas['activemenu'] = str_replace('/','',$this->uri->slash_segment(1));

		if(!empty($params)) $datas = array_merge($datas,$params);
		$this->load->vars($datas);
		$this->template->set_template('weeraya');
		if(!empty($styles)){
			foreach($styles as $style){
				$this->template->add_css('themes/'.$style);	
			}
		}
		if(!empty($scripts)){
			foreach($scripts as $script){
				$this->template->add_js('scripts/'.$script);	
			}
		}		
		$this->template->write_view('content', $page);
		$this->template->render();
	}
}
/* End of file my_controller.php */
/* Location: ./application/libraries/my_controller.php */